<!doctype html>
<html lang="en">
<head>
  <meta charset='utf-8'>
  <title>@yeung2017/utils 1.1.4 | Documentation</title>
  <meta name='viewport' content='width=device-width,initial-scale=1'>
  <link href='assets/bass.css' rel='stylesheet'>
  <link href='assets/style.css' rel='stylesheet'>
  <link href='assets/github.css' rel='stylesheet'>
  <link href='assets/split.css' rel='stylesheet'>
</head>
<body class='documentation m0'>
    <div class='flex'>
      <div id='split-left' class='overflow-auto fs0 height-viewport-100'>
        <div class='py1 px2'>
          <h3 class='mb0 no-anchor'>@yeung2017/utils</h3>
          <div class='mb1'><code>1.1.4</code></div>
          <input
            placeholder='Filter'
            id='filter-input'
            class='col12 block input'
            spellcheck='false'
            autocapitalize='off'
            autocorrect='off'
            type='text' />
          <div id='toc'>
            <ul class='list-reset h5 py1-ul'>
              
                
                <li><a
                  href='#iaddquerytourloptions'
                  class=" toggle-sibling">
                  IAddQueryToUrlOptions
                  <span class='icon'>▸</span>
                </a>
                
                <div class='toggle-target display-none'>
                  
                  
                    <ul class='list-reset py1-ul pl1'>
                      <li class='h5'><span>Instance members</span></li>
                      
                      <li><a
                        href='#iaddquerytourloptionsurl'
                        class='regular pre-open'>
                        #url
                      </a></li>
                      
                      <li><a
                        href='#iaddquerytourloptionsquery'
                        class='regular pre-open'>
                        #query
                      </a></li>
                      
                      <li><a
                        href='#iaddquerytourloptionsmergequery'
                        class='regular pre-open'>
                        #mergeQuery
                      </a></li>
                      
                    </ul>
                  
                  
                  
                </div>
                
                </li>
              
                
                <li><a
                  href='#addquerytourl'
                  class="">
                  addQueryToUrl
                  
                </a>
                
                </li>
              
                
                <li><a
                  href='#iconverttothousandthsoptions'
                  class=" toggle-sibling">
                  IConvertTothousandthsOptions
                  <span class='icon'>▸</span>
                </a>
                
                <div class='toggle-target display-none'>
                  
                  
                    <ul class='list-reset py1-ul pl1'>
                      <li class='h5'><span>Instance members</span></li>
                      
                      <li><a
                        href='#iconverttothousandthsoptionsseparator'
                        class='regular pre-open'>
                        #separator
                      </a></li>
                      
                    </ul>
                  
                  
                  
                </div>
                
                </li>
              
                
                <li><a
                  href='#converttothousandths'
                  class="">
                  convertTothousandths
                  
                </a>
                
                </li>
              
                
                <li><a
                  href='#idateformatoptions'
                  class=" toggle-sibling">
                  IDateFormatOptions
                  <span class='icon'>▸</span>
                </a>
                
                <div class='toggle-target display-none'>
                  
                  
                    <ul class='list-reset py1-ul pl1'>
                      <li class='h5'><span>Instance members</span></li>
                      
                      <li><a
                        href='#idateformatoptionsformat'
                        class='regular pre-open'>
                        #format
                      </a></li>
                      
                      <li><a
                        href='#idateformatoptionsfallback'
                        class='regular pre-open'>
                        #fallback
                      </a></li>
                      
                      <li><a
                        href='#idateformatoptionsismillisecond'
                        class='regular pre-open'>
                        #isMillisecond
                      </a></li>
                      
                      <li><a
                        href='#idateformatoptionsautotensecond'
                        class='regular pre-open'>
                        #autoTenSecond
                      </a></li>
                      
                    </ul>
                  
                  
                  
                </div>
                
                </li>
              
                
                <li><a
                  href='#dateformat'
                  class="">
                  dateFormat
                  
                </a>
                
                </li>
              
                
                <li><a
                  href='#formatnumberdivisor'
                  class="">
                  formatNumberDivisor
                  
                </a>
                
                </li>
              
                
                <li><a
                  href='#formatnumberpercent'
                  class="">
                  formatNumberPercent
                  
                </a>
                
                </li>
              
                
                <li><a
                  href='#formatquery'
                  class="">
                  formatQuery
                  
                </a>
                
                </li>
              
                
                <li><a
                  href='#igettimedurationoptions'
                  class=" toggle-sibling">
                  IGetTimeDurationOptions
                  <span class='icon'>▸</span>
                </a>
                
                <div class='toggle-target display-none'>
                  
                  
                    <ul class='list-reset py1-ul pl1'>
                      <li class='h5'><span>Instance members</span></li>
                      
                      <li><a
                        href='#igettimedurationoptionsstarttimestamp'
                        class='regular pre-open'>
                        #startTimeStamp
                      </a></li>
                      
                      <li><a
                        href='#igettimedurationoptionsendtimestamp'
                        class='regular pre-open'>
                        #endTimeStamp
                      </a></li>
                      
                    </ul>
                  
                  
                  
                </div>
                
                </li>
              
                
                <li><a
                  href='#igettimedurationresult'
                  class=" toggle-sibling">
                  IGetTimeDurationResult
                  <span class='icon'>▸</span>
                </a>
                
                <div class='toggle-target display-none'>
                  
                  
                    <ul class='list-reset py1-ul pl1'>
                      <li class='h5'><span>Instance members</span></li>
                      
                      <li><a
                        href='#igettimedurationresultddmax'
                        class='regular pre-open'>
                        #DDMax
                      </a></li>
                      
                      <li><a
                        href='#igettimedurationresultdd'
                        class='regular pre-open'>
                        #DD
                      </a></li>
                      
                      <li><a
                        href='#igettimedurationresulthhmax'
                        class='regular pre-open'>
                        #HHMax
                      </a></li>
                      
                      <li><a
                        href='#igettimedurationresulthh'
                        class='regular pre-open'>
                        #HH
                      </a></li>
                      
                      <li><a
                        href='#igettimedurationresultmmmax'
                        class='regular pre-open'>
                        #mmMax
                      </a></li>
                      
                      <li><a
                        href='#igettimedurationresultmm'
                        class='regular pre-open'>
                        #mm
                      </a></li>
                      
                      <li><a
                        href='#igettimedurationresultssmax'
                        class='regular pre-open'>
                        #ssMax
                      </a></li>
                      
                      <li><a
                        href='#igettimedurationresultss'
                        class='regular pre-open'>
                        #ss
                      </a></li>
                      
                      <li><a
                        href='#igettimedurationresultsssmax'
                        class='regular pre-open'>
                        #SSSMax
                      </a></li>
                      
                      <li><a
                        href='#igettimedurationresultsss'
                        class='regular pre-open'>
                        #SSS
                      </a></li>
                      
                      <li><a
                        href='#igettimedurationresultduration'
                        class='regular pre-open'>
                        #duration
                      </a></li>
                      
                    </ul>
                  
                  
                  
                </div>
                
                </li>
              
                
                <li><a
                  href='#gettimeduration'
                  class="">
                  getTimeDuration
                  
                </a>
                
                </li>
              
                
                <li><a
                  href='#iiscommonappbrosweroptions'
                  class=" toggle-sibling">
                  IIsCommonAppBroswerOptions
                  <span class='icon'>▸</span>
                </a>
                
                <div class='toggle-target display-none'>
                  
                  
                    <ul class='list-reset py1-ul pl1'>
                      <li class='h5'><span>Instance members</span></li>
                      
                      <li><a
                        href='#iiscommonappbrosweroptionspattern'
                        class='regular pre-open'>
                        #pattern
                      </a></li>
                      
                    </ul>
                  
                  
                  
                </div>
                
                </li>
              
                
                <li><a
                  href='#iscommonappbroswer'
                  class="">
                  isCommonAppBroswer
                  
                </a>
                
                </li>
              
                
                <li><a
                  href='#safajsonparse'
                  class="">
                  safaJsonParse
                  
                </a>
                
                </li>
              
                
                <li><a
                  href='#safejsonstringify'
                  class="">
                  safeJsonStringify
                  
                </a>
                
                </li>
              
                
                <li><a
                  href='#padendzero'
                  class="">
                  padEndZero
                  
                </a>
                
                </li>
              
                
                <li><a
                  href='#isplitpriceresult'
                  class=" toggle-sibling">
                  ISplitPriceResult
                  <span class='icon'>▸</span>
                </a>
                
                <div class='toggle-target display-none'>
                  
                  
                    <ul class='list-reset py1-ul pl1'>
                      <li class='h5'><span>Instance members</span></li>
                      
                      <li><a
                        href='#isplitpriceresultprice'
                        class='regular pre-open'>
                        #price
                      </a></li>
                      
                      <li><a
                        href='#isplitpriceresultinteger'
                        class='regular pre-open'>
                        #integer
                      </a></li>
                      
                      <li><a
                        href='#isplitpriceresultdecimal'
                        class='regular pre-open'>
                        #decimal
                      </a></li>
                      
                      <li><a
                        href='#isplitpriceresultdecimalnopoint'
                        class='regular pre-open'>
                        #decimalNoPoint
                      </a></li>
                      
                      <li><a
                        href='#isplitpriceresultpricefixed'
                        class='regular pre-open'>
                        #priceFixed
                      </a></li>
                      
                    </ul>
                  
                  
                  
                </div>
                
                </li>
              
                
                <li><a
                  href='#splitprice'
                  class="">
                  splitPrice
                  
                </a>
                
                </li>
              
                
                <li><a
                  href='#itofenoptions'
                  class=" toggle-sibling">
                  IToFenOptions
                  <span class='icon'>▸</span>
                </a>
                
                <div class='toggle-target display-none'>
                  
                  
                    <ul class='list-reset py1-ul pl1'>
                      <li class='h5'><span>Instance members</span></li>
                      
                      <li><a
                        href='#itofenoptionsdecimal'
                        class='regular pre-open'>
                        #decimal
                      </a></li>
                      
                    </ul>
                  
                  
                  
                </div>
                
                </li>
              
                
                <li><a
                  href='#tofen'
                  class="">
                  toFen
                  
                </a>
                
                </li>
              
                
                <li><a
                  href='#itoyuanoptions'
                  class=" toggle-sibling">
                  IToYuanOptions
                  <span class='icon'>▸</span>
                </a>
                
                <div class='toggle-target display-none'>
                  
                  
                    <ul class='list-reset py1-ul pl1'>
                      <li class='h5'><span>Instance members</span></li>
                      
                      <li><a
                        href='#itoyuanoptionsdecimal'
                        class='regular pre-open'>
                        #decimal
                      </a></li>
                      
                      <li><a
                        href='#itoyuanoptionsdecimalifneeded'
                        class='regular pre-open'>
                        #decimalIfNeeded
                      </a></li>
                      
                      <li><a
                        href='#itoyuanoptionsthousandcentimeter'
                        class='regular pre-open'>
                        #thousandCentimeter
                      </a></li>
                      
                      <li><a
                        href='#itoyuanoptionsthousandcentimeterseparator'
                        class='regular pre-open'>
                        #thousandCentimeterSeparator
                      </a></li>
                      
                    </ul>
                  
                  
                  
                </div>
                
                </li>
              
                
                <li><a
                  href='#toyuan'
                  class="">
                  toYuan
                  
                </a>
                
                </li>
              
            </ul>
          </div>
          <div class='mt1 h6 quiet'>
            <a href='https://documentation.js.org/reading-documentation.html'>Need help reading this?</a>
          </div>
        </div>
      </div>
      <div id='split-right' class='relative overflow-auto height-viewport-100'>
        
          
          <section class='p2 mb2 clearfix bg-white minishadow'>

  
  <div class='clearfix'>
    
    <h3 class='fl m0' id='iaddquerytourloptions'>
      IAddQueryToUrlOptions
    </h3>
    
    
  </div>
  

  <p>addQueryToUrl方法的选项</p>

    <div class='pre p1 fill-light mt0'>IAddQueryToUrlOptions</div>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  
    <div class='py1 quiet mt1 prose-big'>Instance Members</div>
    <div class="clearfix">
  
    <div class='border-bottom' id='iaddquerytourloptionsurl'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>url</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>url</p>

    <div class='pre p1 fill-light mt0'>url</div>
  
    <p>
      Type:
      <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
    <div class='border-bottom' id='iaddquerytourloptionsquery'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>query</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>查询字符串，也可以是个对象</p>

    <div class='pre p1 fill-light mt0'>query</div>
  
    <p>
      Type:
      (<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a>)
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
    <div class='border-bottom' id='iaddquerytourloptionsmergequery'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>mergeQuery</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>是否覆盖更新query，
比如addQueryToUrl({url:'xxx?a=1',query:{a:2},mergeQuery:true})将会是xxx?a=2，而不是xxx?a=1&#x26;a=2</p>

    <div class='pre p1 fill-light mt0'>mergeQuery</div>
  
    <p>
      Type:
      <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
</div>

  

  

  
</section>

          
        
          
          <section class='p2 mb2 clearfix bg-white minishadow'>

  
  <div class='clearfix'>
    
    <h3 class='fl m0' id='addquerytourl'>
      addQueryToUrl
    </h3>
    
    
  </div>
  

  <p>将query添加到url上。
注意:如果query中项的值是一个对象或者数组,
将会JSON.stringify这个值(这与qs),如果要还原这个值,请使用JSON.parse(decodeURIComponent(decodeURIComponent(value)))。
如果想将query还原成对象,可以使用formatQuery方法。</p>

    <div class='pre p1 fill-light mt0'>addQueryToUrl(options: <a href="#iaddquerytourloptions">IAddQueryToUrlOptions</a>?): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></div>
  
  

  
  
  
  
  
  <div>Since: 1.0.2</div>

  
    <div class='py1 quiet mt1 prose-big'>Parameters</div>
    <div class='prose'>
      
        <div class='space-bottom0'>
          <div>
            <span class='code bold'>options</span> <code class='quiet'>(<a href="#iaddquerytourloptions">IAddQueryToUrlOptions</a>?
            = <code>{}</code>)</code>
	    
          </div>
          
          <table class='mt1 mb2 fixed-table h5 col-12'>
            <colgroup>
              <col width='30%' />
              <col width='70%' />
            </colgroup>
            <thead>
              <tr class='bold fill-light'>
                <th>Name</th>
                <th>Description</th>
              </tr>
            </thead>
            <tbody class='mt1'>
              
                <tr>
  <td class='break-word'><span class='code bold'>options.url</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>?</code>
  
    (default <code>&#39;&#39;</code>)
  </td>
  <td class='break-word'><span>url
</span></td>
</tr>


              
                <tr>
  <td class='break-word'><span class='code bold'>options.query</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a>)?</code>
  
    (default <code>&#39;&#39;</code>)
  </td>
  <td class='break-word'><span>查询字符串，也可以是个对象
</span></td>
</tr>


              
                <tr>
  <td class='break-word'><span class='code bold'>options.mergeQuery</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>?</code>
  
    (default <code>true</code>)
  </td>
  <td class='break-word'><span>是否覆盖更新query，
</span></td>
</tr>


              
            </tbody>
          </table>
          
        </div>
      
    </div>
  

  

  
    
      <div class='py1 quiet mt1 prose-big'>Returns</div>
      <code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code>:
        拼接好的字符串

      
    
  

  

  

  

  

  

  

  
</section>

          
        
          
          <section class='p2 mb2 clearfix bg-white minishadow'>

  
  <div class='clearfix'>
    
    <h3 class='fl m0' id='iconverttothousandthsoptions'>
      IConvertTothousandthsOptions
    </h3>
    
    
  </div>
  

  <p>convertTothousandths的选项</p>

    <div class='pre p1 fill-light mt0'>IConvertTothousandthsOptions</div>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  
    <div class='py1 quiet mt1 prose-big'>Instance Members</div>
    <div class="clearfix">
  
    <div class='border-bottom' id='iconverttothousandthsoptionsseparator'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>separator</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>分隔符</p>

    <div class='pre p1 fill-light mt0'>separator</div>
  
    <p>
      Type:
      <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
</div>

  

  

  
</section>

          
        
          
          <section class='p2 mb2 clearfix bg-white minishadow'>

  
  <div class='clearfix'>
    
    <h3 class='fl m0' id='converttothousandths'>
      convertTothousandths
    </h3>
    
    
  </div>
  

  <p>将数字字符串转化为千分位</p>

    <div class='pre p1 fill-light mt0'>convertTothousandths(num: (<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>), options: <a href="#iconverttothousandthsoptions">IConvertTothousandthsOptions</a>): any</div>
  
  

  
  
  
  
  
  <div>Since: 1.0.0</div>

  
    <div class='py1 quiet mt1 prose-big'>Parameters</div>
    <div class='prose'>
      
        <div class='space-bottom0'>
          <div>
            <span class='code bold'>num</span> <code class='quiet'>((<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)
            = <code>&#39;&#39;</code>)</code>
	    
          </div>
          
        </div>
      
        <div class='space-bottom0'>
          <div>
            <span class='code bold'>options</span> <code class='quiet'>(<a href="#iconverttothousandthsoptions">IConvertTothousandthsOptions</a>
            = <code>{}</code>)</code>
	    
          </div>
          
          <table class='mt1 mb2 fixed-table h5 col-12'>
            <colgroup>
              <col width='30%' />
              <col width='70%' />
            </colgroup>
            <thead>
              <tr class='bold fill-light'>
                <th>Name</th>
                <th>Description</th>
              </tr>
            </thead>
            <tbody class='mt1'>
              
                <tr>
  <td class='break-word'><span class='code bold'>options.separator</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code>
  
    (default <code>&#39;,&#39;</code>)
  </td>
  <td class='break-word'><span>分隔符
</span></td>
</tr>


              
            </tbody>
          </table>
          
        </div>
      
    </div>
  

  

  
    
      <div class='py1 quiet mt1 prose-big'>Returns</div>
      <code>any</code>:
        {string}

      
    
  

  

  

  

  

  

  

  
</section>

          
        
          
          <section class='p2 mb2 clearfix bg-white minishadow'>

  
  <div class='clearfix'>
    
    <h3 class='fl m0' id='idateformatoptions'>
      IDateFormatOptions
    </h3>
    
    
  </div>
  

  <p>dateFormat方法的选项</p>

    <div class='pre p1 fill-light mt0'>IDateFormatOptions</div>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  
    <div class='py1 quiet mt1 prose-big'>Instance Members</div>
    <div class="clearfix">
  
    <div class='border-bottom' id='idateformatoptionsformat'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>format</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>输出格式,默认为YYYY-MM-DD HH:mm:ss</p>

    <div class='pre p1 fill-light mt0'>format</div>
  
    <p>
      Type:
      <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
    <div class='border-bottom' id='idateformatoptionsfallback'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>fallback</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>时间戳不能正确格式化的时候输出fallback，默认为‘--’</p>

    <div class='pre p1 fill-light mt0'>fallback</div>
  
    <p>
      Type:
      <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
    <div class='border-bottom' id='idateformatoptionsismillisecond'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>isMillisecond</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>是否是毫秒时间戳，默认为true</p>

    <div class='pre p1 fill-light mt0'>isMillisecond</div>
  
    <p>
      Type:
      <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
    <div class='border-bottom' id='idateformatoptionsautotensecond'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>autoTenSecond</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>是否自动认为10位时间戳是秒时间戳，默认为true</p>

    <div class='pre p1 fill-light mt0'>autoTenSecond</div>
  
    <p>
      Type:
      <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
</div>

  

  

  
</section>

          
        
          
          <section class='p2 mb2 clearfix bg-white minishadow'>

  
  <div class='clearfix'>
    
    <h3 class='fl m0' id='dateformat'>
      dateFormat
    </h3>
    
    
  </div>
  

  <p>格式化时间戳，默认输出格式为YYYY-MM-DD HH:mm:ss。不能正确格式化的时候输出fallback，默认为‘--’</p>

    <div class='pre p1 fill-light mt0'>dateFormat(timeStamp: (<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)?, options: <a href="#idateformatoptions">IDateFormatOptions</a>?): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></div>
  
  

  
  
  
  
  
  <div>Since: 1.0.4</div>

  
    <div class='py1 quiet mt1 prose-big'>Parameters</div>
    <div class='prose'>
      
        <div class='space-bottom0'>
          <div>
            <span class='code bold'>timeStamp</span> <code class='quiet'>((<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)?)</code>
	    时间戳

          </div>
          
        </div>
      
        <div class='space-bottom0'>
          <div>
            <span class='code bold'>options</span> <code class='quiet'>(<a href="#idateformatoptions">IDateFormatOptions</a>?
            = <code>{}</code>)</code>
	    选项

          </div>
          
          <table class='mt1 mb2 fixed-table h5 col-12'>
            <colgroup>
              <col width='30%' />
              <col width='70%' />
            </colgroup>
            <thead>
              <tr class='bold fill-light'>
                <th>Name</th>
                <th>Description</th>
              </tr>
            </thead>
            <tbody class='mt1'>
              
                <tr>
  <td class='break-word'><span class='code bold'>options.format</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>?</code>
  
    (default <code>&#39;YYYY-MM-DD HH:mm:ss&#39;</code>)
  </td>
  <td class='break-word'><span>输出格式,默认为YYYY-MM-DD HH:mm:ss
</span></td>
</tr>


              
                <tr>
  <td class='break-word'><span class='code bold'>options.fallback</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>?</code>
  
    (default <code>&#39;--&#39;</code>)
  </td>
  <td class='break-word'><span>时间戳不能正确格式化的时候输出fallback，默认为‘--’
</span></td>
</tr>


              
                <tr>
  <td class='break-word'><span class='code bold'>options.isMillisecond</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>?</code>
  
    (default <code>true</code>)
  </td>
  <td class='break-word'><span>是否是毫秒时间戳，默认为true
</span></td>
</tr>


              
                <tr>
  <td class='break-word'><span class='code bold'>options.autoTenSecond</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>?</code>
  
    (default <code>true</code>)
  </td>
  <td class='break-word'><span>是否自动认为10位时间戳是秒时间戳，默认为true
</span></td>
</tr>


              
            </tbody>
          </table>
          
        </div>
      
    </div>
  

  

  
    
      <div class='py1 quiet mt1 prose-big'>Returns</div>
      <code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code>:
        格式化后的时间戳

      
    
  

  

  

  
    <div class='py1 quiet mt1 prose-big'>Example</div>
    
      
      <pre class='p1 overflow-auto round fill-light'>dateFormat(<span class="hljs-number">1602491858395</span>) <span class="hljs-comment">// 2020-10-12 16:37:38</span>
dateFormat(<span class="hljs-number">1602491858</span>) <span class="hljs-comment">// 2020-10-12 16:37:38</span></pre>
    
  

  

  

  

  
</section>

          
        
          
          <section class='p2 mb2 clearfix bg-white minishadow'>

  
  <div class='clearfix'>
    
    <h3 class='fl m0' id='formatnumberdivisor'>
      formatNumberDivisor
    </h3>
    
    
  </div>
  

  <p>把数字转换成带小数的字符串，默认得到万分之一，并保留指定小数，若小数位不够，用0补齐，如210000转换为21.00（单位是万）</p>

    <div class='pre p1 fill-light mt0'>formatNumberDivisor(number: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, options: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></div>
  
  

  
  
  
  
  
  <div>Since: 1.1.4</div>

  
    <div class='py1 quiet mt1 prose-big'>Parameters</div>
    <div class='prose'>
      
        <div class='space-bottom0'>
          <div>
            <span class='code bold'>number</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>
            = <code>0</code>)</code>
	    
          </div>
          
        </div>
      
        <div class='space-bottom0'>
          <div>
            <span class='code bold'>options</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>
            = <code>{}</code>)</code>
	    选项

          </div>
          
          <table class='mt1 mb2 fixed-table h5 col-12'>
            <colgroup>
              <col width='30%' />
              <col width='70%' />
            </colgroup>
            <thead>
              <tr class='bold fill-light'>
                <th>Name</th>
                <th>Description</th>
              </tr>
            </thead>
            <tbody class='mt1'>
              
                <tr>
  <td class='break-word'><span class='code bold'>options.divisor</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code>
  
    (default <code>10000</code>)
  </td>
  <td class='break-word'><span>除数，默认为10000，如果为100，则表示百分之一，如果为1，则表示原数保留两位小数
</span></td>
</tr>


              
                <tr>
  <td class='break-word'><span class='code bold'>options.precision</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code>
  
    (default <code>2</code>)
  </td>
  <td class='break-word'><span>保留几位小数
</span></td>
</tr>


              
            </tbody>
          </table>
          
        </div>
      
    </div>
  

  

  
    
      <div class='py1 quiet mt1 prose-big'>Returns</div>
      <code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code>:
        
      
    
  

  

  

  
    <div class='py1 quiet mt1 prose-big'>Example</div>
    
      
      <pre class='p1 overflow-auto round fill-light'>formatNumberDivisor(<span class="hljs-number">210000</span>)
<span class="hljs-comment">// 输出为</span>
<span class="hljs-number">21.00</span></pre>
    
      
      <pre class='p1 overflow-auto round fill-light'>formatNumberDivisor(<span class="hljs-number">210000</span>, { <span class="hljs-attr">precision</span>: <span class="hljs-number">0</span> })
<span class="hljs-comment">// 输出为</span>
<span class="hljs-number">21</span></pre>
    
  

  

  

  

  
</section>

          
        
          
          <section class='p2 mb2 clearfix bg-white minishadow'>

  
  <div class='clearfix'>
    
    <h3 class='fl m0' id='formatnumberpercent'>
      formatNumberPercent
    </h3>
    
    
  </div>
  

  <p>得到百分比，并默认保留两位小数，若小数位数不足，则用0补齐，如1.10</p>

    <div class='pre p1 fill-light mt0'>formatNumberPercent(num: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, total: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, options: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></div>
  
  

  
  
  
  
  
  <div>Since: 1.1.4</div>

  
    <div class='py1 quiet mt1 prose-big'>Parameters</div>
    <div class='prose'>
      
        <div class='space-bottom0'>
          <div>
            <span class='code bold'>num</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>
            = <code>0</code>)</code>
	    分子

          </div>
          
        </div>
      
        <div class='space-bottom0'>
          <div>
            <span class='code bold'>total</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>
            = <code>100</code>)</code>
	    分母

          </div>
          
        </div>
      
        <div class='space-bottom0'>
          <div>
            <span class='code bold'>options</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>
            = <code>{}</code>)</code>
	    选项

          </div>
          
          <table class='mt1 mb2 fixed-table h5 col-12'>
            <colgroup>
              <col width='30%' />
              <col width='70%' />
            </colgroup>
            <thead>
              <tr class='bold fill-light'>
                <th>Name</th>
                <th>Description</th>
              </tr>
            </thead>
            <tbody class='mt1'>
              
                <tr>
  <td class='break-word'><span class='code bold'>options.precision</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code>
  
    (default <code>0</code>)
  </td>
  <td class='break-word'><span>保留几位小数
</span></td>
</tr>


              
            </tbody>
          </table>
          
        </div>
      
    </div>
  

  

  
    
      <div class='py1 quiet mt1 prose-big'>Returns</div>
      <code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code>:
        
      
    
  

  

  

  
    <div class='py1 quiet mt1 prose-big'>Example</div>
    
      
      <pre class='p1 overflow-auto round fill-light'>formatNumberPercent(<span class="hljs-number">1</span>, <span class="hljs-number">2</span>)
<span class="hljs-comment">// 输出为</span>
<span class="hljs-number">50.00</span></pre>
    
  

  

  

  

  
</section>

          
        
          
          <section class='p2 mb2 clearfix bg-white minishadow'>

  
  <div class='clearfix'>
    
    <h3 class='fl m0' id='formatquery'>
      formatQuery
    </h3>
    
    
  </div>
  

  <p>格式化查询字符串为对象
查询字符串的值为原始值，包括JSON字符串
需要配合addQueryToUrl使用</p>

    <div class='pre p1 fill-light mt0'>formatQuery(query: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></div>
  
  

  
  
  
  
  
  <div>Since: 1.0.2</div>

  
    <div class='py1 quiet mt1 prose-big'>Parameters</div>
    <div class='prose'>
      
        <div class='space-bottom0'>
          <div>
            <span class='code bold'>query</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>
            = <code>&#39;&#39;</code>)</code>
	    查询字符串 可以是完整的url

          </div>
          
        </div>
      
    </div>
  

  

  
    
      <div class='py1 quiet mt1 prose-big'>Returns</div>
      <code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></code>:
        查询字符串转换成的对象

      
    
  

  

  

  
    <div class='py1 quiet mt1 prose-big'>Example</div>
    
      
      <pre class='p1 overflow-auto round fill-light'>formatQuery(<span class="hljs-string">&#x27;http://xxx?b=2&amp;k=1&amp;a=%5B1%2C2%2C3%5D&#x27;</span>)
<span class="hljs-comment">// 输出为</span>
{
<span class="hljs-attr">a</span>: [
<span class="hljs-number">1</span>,
<span class="hljs-number">2</span>,
<span class="hljs-number">3</span>,
],
<span class="hljs-attr">k</span>: <span class="hljs-number">1</span>,
<span class="hljs-attr">b</span>: <span class="hljs-number">2</span>,
}</pre>
    
  

  

  

  

  
</section>

          
        
          
          <section class='p2 mb2 clearfix bg-white minishadow'>

  
  <div class='clearfix'>
    
    <h3 class='fl m0' id='igettimedurationoptions'>
      IGetTimeDurationOptions
    </h3>
    
    
  </div>
  

  <p>getTimeDuration方法的选项</p>

    <div class='pre p1 fill-light mt0'>IGetTimeDurationOptions</div>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  
    <div class='py1 quiet mt1 prose-big'>Instance Members</div>
    <div class="clearfix">
  
    <div class='border-bottom' id='igettimedurationoptionsstarttimestamp'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>startTimeStamp</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>起始时间戳 毫秒</p>

    <div class='pre p1 fill-light mt0'>startTimeStamp</div>
  
    <p>
      Type:
      <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
    <div class='border-bottom' id='igettimedurationoptionsendtimestamp'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>endTimeStamp</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>结束时间戳 毫秒</p>

    <div class='pre p1 fill-light mt0'>endTimeStamp</div>
  
    <p>
      Type:
      <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
</div>

  

  

  
</section>

          
        
          
          <section class='p2 mb2 clearfix bg-white minishadow'>

  
  <div class='clearfix'>
    
    <h3 class='fl m0' id='igettimedurationresult'>
      IGetTimeDurationResult
    </h3>
    
    
  </div>
  

  <p>getTimeDuration方法的返回值</p>

    <div class='pre p1 fill-light mt0'>IGetTimeDurationResult</div>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  
    <div class='py1 quiet mt1 prose-big'>Instance Members</div>
    <div class="clearfix">
  
    <div class='border-bottom' id='igettimedurationresultddmax'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>DDMax</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>天部分</p>

    <div class='pre p1 fill-light mt0'>DDMax</div>
  
    <p>
      Type:
      <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
    <div class='border-bottom' id='igettimedurationresultdd'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>DD</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>0-30天部分</p>

    <div class='pre p1 fill-light mt0'>DD</div>
  
    <p>
      Type:
      <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
    <div class='border-bottom' id='igettimedurationresulthhmax'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>HHMax</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>小时部分</p>

    <div class='pre p1 fill-light mt0'>HHMax</div>
  
    <p>
      Type:
      <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
    <div class='border-bottom' id='igettimedurationresulthh'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>HH</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>0-23小时部分</p>

    <div class='pre p1 fill-light mt0'>HH</div>
  
    <p>
      Type:
      <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
    <div class='border-bottom' id='igettimedurationresultmmmax'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>mmMax</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>分钟部分</p>

    <div class='pre p1 fill-light mt0'>mmMax</div>
  
    <p>
      Type:
      <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
    <div class='border-bottom' id='igettimedurationresultmm'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>mm</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>0-59分钟部分</p>

    <div class='pre p1 fill-light mt0'>mm</div>
  
    <p>
      Type:
      <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
    <div class='border-bottom' id='igettimedurationresultssmax'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>ssMax</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>秒部分</p>

    <div class='pre p1 fill-light mt0'>ssMax</div>
  
    <p>
      Type:
      <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
    <div class='border-bottom' id='igettimedurationresultss'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>ss</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>0-59秒部分</p>

    <div class='pre p1 fill-light mt0'>ss</div>
  
    <p>
      Type:
      <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
    <div class='border-bottom' id='igettimedurationresultsssmax'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>SSSMax</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>毫秒部分</p>

    <div class='pre p1 fill-light mt0'>SSSMax</div>
  
    <p>
      Type:
      <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
    <div class='border-bottom' id='igettimedurationresultsss'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>SSS</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>0-999毫秒部分</p>

    <div class='pre p1 fill-light mt0'>SSS</div>
  
    <p>
      Type:
      <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
    <div class='border-bottom' id='igettimedurationresultduration'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>duration</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>Duration实例</p>

    <div class='pre p1 fill-light mt0'>duration</div>
  
    <p>
      Type:
      duration.Duration
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
</div>

  

  

  
</section>

          
        
          
          <section class='p2 mb2 clearfix bg-white minishadow'>

  
  <div class='clearfix'>
    
    <h3 class='fl m0' id='gettimeduration'>
      getTimeDuration
    </h3>
    
    
  </div>
  

  <p>根据起始时间和结束时间得到差值信息</p>

    <div class='pre p1 fill-light mt0'>getTimeDuration(options: <a href="#igettimedurationoptions">IGetTimeDurationOptions</a>): <a href="#igettimedurationresult">IGetTimeDurationResult</a></div>
  
  

  
  
  
  
  
  <div>Since: 1.1.4</div>

  
    <div class='py1 quiet mt1 prose-big'>Parameters</div>
    <div class='prose'>
      
        <div class='space-bottom0'>
          <div>
            <span class='code bold'>options</span> <code class='quiet'>(<a href="#igettimedurationoptions">IGetTimeDurationOptions</a>
            = <code>{}</code>)</code>
	    选项

          </div>
          
          <table class='mt1 mb2 fixed-table h5 col-12'>
            <colgroup>
              <col width='30%' />
              <col width='70%' />
            </colgroup>
            <thead>
              <tr class='bold fill-light'>
                <th>Name</th>
                <th>Description</th>
              </tr>
            </thead>
            <tbody class='mt1'>
              
                <tr>
  <td class='break-word'><span class='code bold'>options.startTimeStamp</span> <code class='quiet'>any</code>
  
    (default <code>0</code>)
  </td>
  <td class='break-word'><span></span></td>
</tr>


              
                <tr>
  <td class='break-word'><span class='code bold'>options.endTimeStamp</span> <code class='quiet'>any</code>
  
    (default <code>0</code>)
  </td>
  <td class='break-word'><span></span></td>
</tr>


              
            </tbody>
          </table>
          
        </div>
      
    </div>
  

  

  
    
      <div class='py1 quiet mt1 prose-big'>Returns</div>
      <code><a href="#igettimedurationresult">IGetTimeDurationResult</a></code>:
        
      
    
  

  

  

  

  

  

  

  
</section>

          
        
          
          <section class='p2 mb2 clearfix bg-white minishadow'>

  
  <div class='clearfix'>
    
    <h3 class='fl m0' id='iiscommonappbrosweroptions'>
      IIsCommonAppBroswerOptions
    </h3>
    
    
  </div>
  

  <p>isCommonAppBroswer的选项</p>

    <div class='pre p1 fill-light mt0'>IIsCommonAppBroswerOptions</div>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  
    <div class='py1 quiet mt1 prose-big'>Instance Members</div>
    <div class="clearfix">
  
    <div class='border-bottom' id='iiscommonappbrosweroptionspattern'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>pattern</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>要匹配的内容，正则表达式，默认为/(micromessenger|qq|weibo)/i</p>

    <div class='pre p1 fill-light mt0'>pattern</div>
  
    <p>
      Type:
      <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp">RegExp</a>
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
</div>

  

  

  
</section>

          
        
          
          <section class='p2 mb2 clearfix bg-white minishadow'>

  
  <div class='clearfix'>
    
    <h3 class='fl m0' id='iscommonappbroswer'>
      isCommonAppBroswer
    </h3>
    
    
  </div>
  

  <p>是否是常见的APP的内置浏览器，默认匹配微信、QQ、微博</p>

    <div class='pre p1 fill-light mt0'>isCommonAppBroswer(ua: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, options: <a href="#iiscommonappbrosweroptions">IIsCommonAppBroswerOptions</a>): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></div>
  
  

  
  
  
  
  
  <div>Since: 1.0.2</div>

  
    <div class='py1 quiet mt1 prose-big'>Parameters</div>
    <div class='prose'>
      
        <div class='space-bottom0'>
          <div>
            <span class='code bold'>ua</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>
            = <code>navigator.userAgent.toLowerCase()</code>)</code>
	    浏览器ua

          </div>
          
        </div>
      
        <div class='space-bottom0'>
          <div>
            <span class='code bold'>options</span> <code class='quiet'>(<a href="#iiscommonappbrosweroptions">IIsCommonAppBroswerOptions</a>
            = <code>{}</code>)</code>
	    
          </div>
          
          <table class='mt1 mb2 fixed-table h5 col-12'>
            <colgroup>
              <col width='30%' />
              <col width='70%' />
            </colgroup>
            <thead>
              <tr class='bold fill-light'>
                <th>Name</th>
                <th>Description</th>
              </tr>
            </thead>
            <tbody class='mt1'>
              
                <tr>
  <td class='break-word'><span class='code bold'>options.pattern</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp">RegExp</a></code>
  
    (default <code>/(micromessenger|qq|weibo)/i</code>)
  </td>
  <td class='break-word'><span>要匹配的内容，正则表达式，默认为/(micromessenger|qq|weibo)/i
</span></td>
</tr>


              
            </tbody>
          </table>
          
        </div>
      
    </div>
  

  

  
    
      <div class='py1 quiet mt1 prose-big'>Returns</div>
      <code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code>:
        
      
    
  

  

  

  

  

  

  

  
</section>

          
        
          
          <section class='p2 mb2 clearfix bg-white minishadow'>

  
  <div class='clearfix'>
    
    <h3 class='fl m0' id='safajsonparse'>
      safaJsonParse
    </h3>
    
    
  </div>
  

  <p>安全地解析JSON字符串。</p>
<p>该函数尝试解析一个给定的字符串为JSON对象。如果解析失败，由于JSON格式不正确或其他原因，
函数将返回<code>undefined</code>，而不是抛出错误。这种方式可以更优雅地处理解析错误，避免了程序因捕获异常而中断。</p>

    <div class='pre p1 fill-light mt0'>safaJsonParse(data: any): any</div>
  
  

  
  
  
  
  
  

  
    <div class='py1 quiet mt1 prose-big'>Parameters</div>
    <div class='prose'>
      
        <div class='space-bottom0'>
          <div>
            <span class='code bold'>data</span> <code class='quiet'>(any)</code>
	    要解析的JSON字符串。

          </div>
          
        </div>
      
    </div>
  

  

  
    
      <div class='py1 quiet mt1 prose-big'>Returns</div>
      <code>any</code>:
        解析后的JSON对象，如果解析失败则返回
<code>undefined</code>
。

      
    
  

  

  

  

  

  

  

  
</section>

          
        
          
          <section class='p2 mb2 clearfix bg-white minishadow'>

  
  <div class='clearfix'>
    
    <h3 class='fl m0' id='safejsonstringify'>
      safeJsonStringify
    </h3>
    
    
  </div>
  

  <p>安全地将数据转换为JSON字符串。</p>
<p>该函数尝试将给定的数据转换为JSON字符串。如果转换过程中发生错误（例如，数据结构不被支持），
则函数会安静地失败，返回<code>undefined</code>而不是抛出异常。这使得调用者可以更易于处理不可预计的
数据结构或类型，而不会导致程序因异常而中断。</p>

    <div class='pre p1 fill-light mt0'>safeJsonStringify(data: any): any</div>
  
  

  
  
  
  
  
  

  
    <div class='py1 quiet mt1 prose-big'>Parameters</div>
    <div class='prose'>
      
        <div class='space-bottom0'>
          <div>
            <span class='code bold'>data</span> <code class='quiet'>(any)</code>
	    要转换为JSON字符串的数据。

          </div>
          
        </div>
      
    </div>
  

  

  
    
      <div class='py1 quiet mt1 prose-big'>Returns</div>
      <code>any</code>:
        成功时返回数据的JSON字符串表示；失败时返回
<code>undefined</code>
。

      
    
  

  

  

  

  

  

  

  
</section>

          
        
          
          <section class='p2 mb2 clearfix bg-white minishadow'>

  
  <div class='clearfix'>
    
    <h3 class='fl m0' id='padendzero'>
      padEndZero
    </h3>
    
    
  </div>
  

  <p>根据精度，补齐末位的0</p>

    <div class='pre p1 fill-light mt0'>padEndZero(num: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, precision: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></div>
  
  

  
  
  
  
  
  <div>Since: 1.1.4</div>

  
    <div class='py1 quiet mt1 prose-big'>Parameters</div>
    <div class='prose'>
      
        <div class='space-bottom0'>
          <div>
            <span class='code bold'>num</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>
            = <code>0</code>)</code>
	    
          </div>
          
        </div>
      
        <div class='space-bottom0'>
          <div>
            <span class='code bold'>precision</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>
            = <code>0</code>)</code>
	    
          </div>
          
        </div>
      
    </div>
  

  

  
    
      <div class='py1 quiet mt1 prose-big'>Returns</div>
      <code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code>:
        
      
    
  

  

  

  
    <div class='py1 quiet mt1 prose-big'>Example</div>
    
      
      <pre class='p1 overflow-auto round fill-light'>padEndZero(<span class="hljs-number">1.1</span>, <span class="hljs-number">2</span>)
<span class="hljs-comment">// 输出为</span>
<span class="hljs-number">1.10</span></pre>
    
  

  

  

  

  
</section>

          
        
          
          <section class='p2 mb2 clearfix bg-white minishadow'>

  
  <div class='clearfix'>
    
    <h3 class='fl m0' id='isplitpriceresult'>
      ISplitPriceResult
    </h3>
    
    
  </div>
  

  <p>splitPrice的返回值</p>

    <div class='pre p1 fill-light mt0'>ISplitPriceResult</div>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  
    <div class='py1 quiet mt1 prose-big'>Instance Members</div>
    <div class="clearfix">
  
    <div class='border-bottom' id='isplitpriceresultprice'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>price</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>原始的价格</p>

    <div class='pre p1 fill-light mt0'>price</div>
  
    <p>
      Type:
      (<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>)
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
    <div class='border-bottom' id='isplitpriceresultinteger'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>integer</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>整数部分</p>

    <div class='pre p1 fill-light mt0'>integer</div>
  
    <p>
      Type:
      <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
    <div class='border-bottom' id='isplitpriceresultdecimal'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>decimal</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>小数部分</p>

    <div class='pre p1 fill-light mt0'>decimal</div>
  
    <p>
      Type:
      <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
    <div class='border-bottom' id='isplitpriceresultdecimalnopoint'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>decimalNoPoint</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>小数部分没有小数点部分</p>

    <div class='pre p1 fill-light mt0'>decimalNoPoint</div>
  
    <p>
      Type:
      <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
    <div class='border-bottom' id='isplitpriceresultpricefixed'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>priceFixed</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>整数加小数部分</p>

    <div class='pre p1 fill-light mt0'>priceFixed</div>
  
    <p>
      Type:
      <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
</div>

  

  

  
</section>

          
        
          
          <section class='p2 mb2 clearfix bg-white minishadow'>

  
  <div class='clearfix'>
    
    <h3 class='fl m0' id='splitprice'>
      splitPrice
    </h3>
    
    
  </div>
  

  <p>格式化价格，返回一个对象，包含原始的价格、整数部分、小数部分、小数部分没有小数点部分、整数加小数部分。
如果想要保留合适的小数位数请在调用该方法之前处理好</p>

    <div class='pre p1 fill-light mt0'>splitPrice(price: (<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)): <a href="#isplitpriceresult">ISplitPriceResult</a></div>
  
  

  
  
  
  
  
  <div>Since: 1.0.9</div>

  
    <div class='py1 quiet mt1 prose-big'>Parameters</div>
    <div class='prose'>
      
        <div class='space-bottom0'>
          <div>
            <span class='code bold'>price</span> <code class='quiet'>((<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>))</code>
	    价格

          </div>
          
        </div>
      
    </div>
  

  

  
    
      <div class='py1 quiet mt1 prose-big'>Returns</div>
      <code><a href="#isplitpriceresult">ISplitPriceResult</a></code>:
        包含原始的价格、整数部分、小数部分、小数部分没有小数点部分、整数加小数部分的对象

      
    
  

  

  

  
    <div class='py1 quiet mt1 prose-big'>Example</div>
    
      
      <pre class='p1 overflow-auto round fill-light'>splitPrice(<span class="hljs-number">1.2</span>)
<span class="hljs-comment">// 输出为</span>
{
<span class="hljs-attr">price</span>: <span class="hljs-number">1.2</span>,
<span class="hljs-attr">integer</span>: <span class="hljs-string">&#x27;1&#x27;</span>,
<span class="hljs-attr">decimal</span>: <span class="hljs-string">&#x27;.2&#x27;</span>,
<span class="hljs-attr">decimalNoPoint</span>: <span class="hljs-string">&#x27;2&#x27;</span>,
<span class="hljs-attr">priceFixed</span>: <span class="hljs-string">&#x27;1.2&#x27;</span>,
}</pre>
    
  

  

  

  

  
</section>

          
        
          
          <section class='p2 mb2 clearfix bg-white minishadow'>

  
  <div class='clearfix'>
    
    <h3 class='fl m0' id='itofenoptions'>
      IToFenOptions
    </h3>
    
    
  </div>
  

  <p>toFen的选项</p>

    <div class='pre p1 fill-light mt0'>IToFenOptions</div>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  
    <div class='py1 quiet mt1 prose-big'>Instance Members</div>
    <div class="clearfix">
  
    <div class='border-bottom' id='itofenoptionsdecimal'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>decimal</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>保留几位小数，默认为0</p>

    <div class='pre p1 fill-light mt0'>decimal</div>
  
    <p>
      Type:
      <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
</div>

  

  

  
</section>

          
        
          
          <section class='p2 mb2 clearfix bg-white minishadow'>

  
  <div class='clearfix'>
    
    <h3 class='fl m0' id='tofen'>
      toFen
    </h3>
    
    
  </div>
  

  <p>将元转换成分</p>

    <div class='pre p1 fill-light mt0'>toFen(yuan: (<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>), options: <a href="#itofenoptions">IToFenOptions</a>): any</div>
  
  

  
  
  
  
  
  <div>Since: 1.0.1</div>

  
    <div class='py1 quiet mt1 prose-big'>Parameters</div>
    <div class='prose'>
      
        <div class='space-bottom0'>
          <div>
            <span class='code bold'>yuan</span> <code class='quiet'>((<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>))</code>
	    
          </div>
          
        </div>
      
        <div class='space-bottom0'>
          <div>
            <span class='code bold'>options</span> <code class='quiet'>(<a href="#itofenoptions">IToFenOptions</a>
            = <code>{}</code>)</code>
	    
          </div>
          
          <table class='mt1 mb2 fixed-table h5 col-12'>
            <colgroup>
              <col width='30%' />
              <col width='70%' />
            </colgroup>
            <thead>
              <tr class='bold fill-light'>
                <th>Name</th>
                <th>Description</th>
              </tr>
            </thead>
            <tbody class='mt1'>
              
                <tr>
  <td class='break-word'><span class='code bold'>options.decimal</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code>
  
    (default <code>0</code>)
  </td>
  <td class='break-word'><span>保留几位小数，默认为0
</span></td>
</tr>


              
            </tbody>
          </table>
          
        </div>
      
    </div>
  

  

  
    
      <div class='py1 quiet mt1 prose-big'>Returns</div>
      <code>any</code>:
        {number}

      
    
  

  

  

  
    <div class='py1 quiet mt1 prose-big'>Example</div>
    
      
      <pre class='p1 overflow-auto round fill-light'>toFen(<span class="hljs-number">1.25</span> <span class="hljs-comment">// 125</span>
toFen(<span class="hljs-number">19.9</span>) <span class="hljs-comment">// 1990,不是1989.9999999999998</span></pre>
    
  

  

  

  

  
</section>

          
        
          
          <section class='p2 mb2 clearfix bg-white minishadow'>

  
  <div class='clearfix'>
    
    <h3 class='fl m0' id='itoyuanoptions'>
      IToYuanOptions
    </h3>
    
    
  </div>
  

  <p>toYuan的选项</p>

    <div class='pre p1 fill-light mt0'>IToYuanOptions</div>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  
    <div class='py1 quiet mt1 prose-big'>Instance Members</div>
    <div class="clearfix">
  
    <div class='border-bottom' id='itoyuanoptionsdecimal'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>decimal</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>保留几位小数，默认为2</p>

    <div class='pre p1 fill-light mt0'>decimal</div>
  
    <p>
      Type:
      <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
    <div class='border-bottom' id='itoyuanoptionsdecimalifneeded'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>decimalIfNeeded</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>是否只显示必要的小数,比如5.00将显示为5,5.10将显示为5.1，默认为false</p>

    <div class='pre p1 fill-light mt0'>decimalIfNeeded</div>
  
    <p>
      Type:
      <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
    <div class='border-bottom' id='itoyuanoptionsthousandcentimeter'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>thousandCentimeter</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>是否千分位</p>

    <div class='pre p1 fill-light mt0'>thousandCentimeter</div>
  
    <p>
      Type:
      <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
    <div class='border-bottom' id='itoyuanoptionsthousandcentimeterseparator'>
      <div class="clearfix small pointer toggle-sibling">
        <div class="py1 contain">
            <a class='icon pin-right py1 dark-link caret-right'>▸</a>
            <span class='code strong strong truncate'>thousandCentimeterSeparator</span>
        </div>
      </div>
      <div class="clearfix display-none toggle-target">
        <section class='p2 mb2 clearfix bg-white minishadow'>

  

  <p>千分位符号</p>

    <div class='pre p1 fill-light mt0'>thousandCentimeterSeparator</div>
  
    <p>
      Type:
      <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>
    </p>
  
  

  
  
  
  
  
  

  

  

  

  

  

  

  

  

  

  
</section>

      </div>
    </div>
  
</div>

  

  

  
</section>

          
        
          
          <section class='p2 mb2 clearfix bg-white minishadow'>

  
  <div class='clearfix'>
    
    <h3 class='fl m0' id='toyuan'>
      toYuan
    </h3>
    
    
  </div>
  

  <p>分转化成元，分一般为整数，但该方法也支持小数。
0.105.toFixed(2) 返回的是 0.1 而不是 0.11，所以不用toFixed</p>

    <div class='pre p1 fill-light mt0'>toYuan(num: (<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>), options: <a href="#itoyuanoptions">IToYuanOptions</a>): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></div>
  
  

  
  
  
  
  
  <div>Since: 1.0.1</div>

  
    <div class='py1 quiet mt1 prose-big'>Parameters</div>
    <div class='prose'>
      
        <div class='space-bottom0'>
          <div>
            <span class='code bold'>num</span> <code class='quiet'>((<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>))</code>
	    分,不一定是整数

          </div>
          
        </div>
      
        <div class='space-bottom0'>
          <div>
            <span class='code bold'>options</span> <code class='quiet'>(<a href="#itoyuanoptions">IToYuanOptions</a>
            = <code>{}</code>)</code>
	    选项

          </div>
          
          <table class='mt1 mb2 fixed-table h5 col-12'>
            <colgroup>
              <col width='30%' />
              <col width='70%' />
            </colgroup>
            <thead>
              <tr class='bold fill-light'>
                <th>Name</th>
                <th>Description</th>
              </tr>
            </thead>
            <tbody class='mt1'>
              
                <tr>
  <td class='break-word'><span class='code bold'>options.decimal</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code>
  
    (default <code>2</code>)
  </td>
  <td class='break-word'><span>保留几位小数，默认为2
</span></td>
</tr>


              
                <tr>
  <td class='break-word'><span class='code bold'>options.thousandCentimeter</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code>
  
    (default <code>false</code>)
  </td>
  <td class='break-word'><span>是否千分位
</span></td>
</tr>


              
                <tr>
  <td class='break-word'><span class='code bold'>options.thousandCentimeterSeparator</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code>
  
    (default <code>&#39;,&#39;</code>)
  </td>
  <td class='break-word'><span>千分位符号
</span></td>
</tr>


              
                <tr>
  <td class='break-word'><span class='code bold'>options.decimalIfNeeded</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code>
  
    (default <code>false</code>)
  </td>
  <td class='break-word'><span>是否只显示必要的小数,比如5.00将显示为5,5.10将显示为5.1，默认为false
</span></td>
</tr>


              
            </tbody>
          </table>
          
        </div>
      
    </div>
  

  

  
    
      <div class='py1 quiet mt1 prose-big'>Returns</div>
      <code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code>:
        格式化后的字符串元

      
    
  

  

  

  
    <div class='py1 quiet mt1 prose-big'>Example</div>
    
      
      <pre class='p1 overflow-auto round fill-light'>toYuan(<span class="hljs-number">100</span>) <span class="hljs-comment">// 1.00</span></pre>
    
  

  

  

  

  
</section>

          
        
      </div>
    </div>
  <script src='assets/anchor.js'></script>
  <script src='assets/split.js'></script>
  <script src='assets/site.js'></script>
</body>
</html>
